<template>
<svg aria-hidden="true" :style="props.style">
    <use :href="symbolId" :fill="props.color" />
</svg>
</template>

<script lang="ts" setup>
import { computed, defineProps, defineExpose } from "vue";

const props = defineProps({
    name: {
        type: String,
        required: true
    },
    prefix: {
        type: String,
        default: 'icon'
    },
    color: {
        type: String,
        default: '#333'
    },
    style: {
        type: Object,
        default: {},
    },
})

const symbolId = computed(() => `#${props.prefix}-${props.name}`)

defineExpose({
    symbolId
})
</script>

<style lang="scss" scoped>
</style>